<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head></h:head> 
<body> 

        <ui:composition template="../template.xhtml">

            <ui:define name="content">
				
				<p:panel id="congrats" header="Congratulazioni!" style="">  
		            <h:panelGrid columns="1" style="width:100%"> 
		            	La prenotazione è andata a buon fine!
		            	
		            	<br /> 
			        
		            </h:panelGrid>
		        </p:panel> 
		        
		        
            	<p:panel id="display" header="Invita Amici" style="margin-bottom:10px;">  
			        
	            	<p:messages id="messages" />  
	            	<h:panelGroup layout="block"  rendered="#{not empty packetFrontend.inviteList}">
		            	<b>Amici invitati:</b>
				        <p:dataList value="#{packetFrontend.inviteList}" var="i">  
						    #{i.receivingEmail}  
						</p:dataList>
					</h:panelGroup>
						 
	            	<h:form>
	            		<h:panelGrid columns="4">
		            		<h:outputLabel for="friend_email" value="Inserisci l'email di un amico" />
		            		<p:inputText id="friend_email" value="#{packetFrontend.friendEmail}">
		            			<f:validateRegex pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
							</p:inputText>
		            		<p:message for="friend_email" />
							<h:commandButton value="Invita" action="#{packetFrontend.inviteFriend}" />
						</h:panelGrid>
	            	</h:form>
			    </p:panel>  
				
	
			</ui:define>
        </ui:composition>
</body> 
</html>
